import themeColor from "../assets/js/theme-color";
class Icon {
    constructor(type) {
        this.type = type;
        this.init();
    }
    init() {
        let element = document.createElement('i')
        element.style.fontSize = '30px'
        if (this.type == 'success') {
            element.className = 'iconfont icon-chenggong Messageicon';
            element.style.color = themeColor.success;
            element.style.fontSize = '27px'
        }
        else if (this.type == 'warning') {
            element.className = 'iconfont icon-jinggao Messageicon';
            element.style.color = themeColor.warning;
        }
        else if (this.type == 'info') {
            element.className = 'iconfont icon-icon Messageicon';
            element.style.color = themeColor.info;
            element.style.fontSize = '27px'
        }
        else if (this.type == 'error') {
            element.className = 'iconfont icon-shibai Messageicon';
            element.style.color = themeColor.error;
        }
        else {
            element.className = 'iconfont icon-icon Messageicon';
            element.style.color = themeColor.info;
            element.style.fontSize = '27px'
        }
        this.element = element;
    }
    getElement() {
        return this.element;
    }
}
export default Icon